<template>
	<el-drawer title="客户关怀详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="关怀标题" prop="title">{{form.title}}
					</el-form-item>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="关怀类型" prop="careType">{{form.careTypeName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="审批人" prop="approvedUser">{{form.approvedUserName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="客户名称" prop="customerId">{{form.cnName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="相关人员" prop="linkManId">{{form.linkManName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="开始时间" prop="careTime" maxlength="80">{{form.careTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="关怀预算" prop="careFunds">{{form.careFunds}}/元
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="关怀备注">{{ form.remark }}
					</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true" ></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'

export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			form: {
				recordId:'',
				title: '',
				careTypeName: '',
				cnName: '',
				linkManName:'',
				careTime:'',
				careFunds: '',
				remark: '',
				attachId:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model) {
			this.model = model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data) {
			this.form.recordId = data.recordId
			this.form.title = data.title
			this.form.careTypeName = data.careTypeName
			this.form.attachId = data.attachId
			this.form.approvedUserName = data.approvedUserName
			this.form.cnName = data.cnName
			this.form.linkManName = data.linkManName
			this.form.careTime = data.careTime
			this.form.careFunds = data.careFunds
			this.form.remark = data.remark
		}
	}
}
</script>

<style>
</style>
